package jtacck.labmedicine;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import jvm.jtacck.db.records.ClientSite;
import jvm.jtacck.db.records.Hospital;
import jvm.jtacck.db.records.ShippingInformation;

public class RouteData {
    private Map<Hospital, List<ClientSite>> hospMap;
    private Map<ClientSite, List<ShippingInformation>> siteMap;

    public RouteData() {
        hospMap = new LinkedHashMap<Hospital, List<ClientSite>>();
        siteMap = new LinkedHashMap<ClientSite, List<ShippingInformation>>();
    }

    public void addHospital(Hospital hosp, LinkedHashMap<ClientSite, List<ShippingInformation>> sites) {
        List<ClientSite> site = new ArrayList<ClientSite>();
        for(ClientSite s : sites.keySet())
            site.add(s);
        hospMap.put(hosp, site);
        siteMap.putAll(sites);
    }
    
    public void addClientSite(ClientSite site, List<ShippingInformation> pack) {
        siteMap.put(site, pack);
    }
    
    public List<ClientSite> getSites(Hospital hosp) {
        return hospMap.get(hosp);
    }
    
    public List<ShippingInformation> getPackages(ClientSite site) {
        return siteMap.get(site);
    }
}